class Categorys{
    String name
    String description
    Integer sequencer = 0 // 排序 
    School school
 
    
    Categorys parent
    static hasMany = [ children : Categorys ]

    static mapping = {
       table 'xedu_categorys'
  
       sort  sequencer : 'asc'
       children sort:'sequencer'

    }

    static constraints = {
        name(size:1..250,blank:false)
        description(size:0..500,blank:true)
        sequencer(range: 0..100, nullable:false)
        parent()
        school()
    
    }

    String toString() {
        "${name}"
    } 
}
